-
-
Notifications
You must be signed in to change notification settings - Fork 2.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Form object refactoring #11905
Form object refactoring #11905
Conversation
together with migration that will create the columns and migrates data from lead_field column. I cleaned the entity a bit too. It was full of verbose syntax, strings over constants and comments that did not bring any value.
by not extending FormTestAbstract And shorter syntax is used to create mocks
plus removing inheritance from tests, stop booting kernel for unit tests, speeding up tests by 3 seconds.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I tested locally, this PR is a great addition. It works as described
RTC assuming the comments from @escopecz on the code review are satisfied, which it looks like they are. |
d5a9620
@RCheesley @escopecz @mabumusa1 I removed the commented code that was unnecessary. This code is not used and shouldn't affect anything. Could you please test and re-approve it again. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Approving this PR again, after the removal of unused code
Thanks for all the testing folks, will commit this once the tests complete! 🚀 |
* upstream/5.x: TPROD-334 - MauticCrmBundle - Migrate PHP Templates to Twig (mautic#11936) TPROD-333 - MauticClearbitBundle - Convert PHP Templates to Twig Templates (mautic#11937) Form object refactoring (mautic#11905) docs: add volha-pivavarchyk as a contributor for code (mautic#11940) quick smoke test TPROD-321 - NotificationBundle - Popup
… import/TPROD-319 * 'import/TPROD-319' of github.com:JoshuaEstes/mautic: (33 commits) TPROD-334 - MauticCrmBundle - Migrate PHP Templates to Twig (mautic#11936) TPROD-333 - MauticClearbitBundle - Convert PHP Templates to Twig Templates (mautic#11937) Form object refactoring (mautic#11905) docs: add volha-pivavarchyk as a contributor for code (mautic#11940) finish templates TPROD-232 - MauticFullContactBundle - Convert PHP Templates to Twig Templates twig lint builder works test check check checkpoint categorylist slot bug fix, cleanup html validation form theme form theme template cleanup cleanup make sure builder uses twig templates instead of php ...
* upstream/5.x: (37 commits) TPROD-334 - MauticCrmBundle - Migrate PHP Templates to Twig (mautic#11936) TPROD-333 - MauticClearbitBundle - Convert PHP Templates to Twig Templates (mautic#11937) Form object refactoring (mautic#11905) docs: add volha-pivavarchyk as a contributor for code (mautic#11940) All contributors/add lord rembo (mautic#11935) finish templates TPROD-232 - MauticFullContactBundle - Convert PHP Templates to Twig Templates Update UPGRADE-PHP-TO-TWIG-TEMPLATES.md (mautic#11921) twig lint builder works test check check checkpoint categorylist slot bug fix, cleanup TPROD-319 - LeadBundle - Custom Fields Templates (mautic#11819) html validation form theme form theme template ...
This pull request has been mentioned on Mautic Forums. There might be relevant details there: |
This pull request has been mentioned on Mautic Forums. There might be relevant details there: |
Description:
This PR replaces PR #11234: rebased and errors fixes
Steps to test this PR:
Open mautic/mautic on Gitpod or pull down for testing locally (see docs on testing PRs here) - as you need to do some things before applying the PR.
Before you checkout this PR:
Create a form with at least 4 fields. One mapped to the contact email field, one mapped to the company field under the contact opt group, one mapped to the primary company city field. The fourth field should not be mapped to any field.
Check out this PR - in Gitpod on the left hand side, look for the Github icon, then find this PR and right click to checkout the PR:
Run the migration using the terminal tab.
Run
ddev exec bin/console doctrine:migrations:execute --up 20200415135706
. Note: you can roll back your changes withddev exec bin/console doctrine:migrations:execute --down 20200415135706
if needed.Open PHPMyAdmin under the Ports tab on Gitpod, look for the port 8036. Open it in a tab.
Open the database named 'db' and go to the
form_fields
table and check that the last 2 columns aremapped_object
andmapped_field
. The field that was mapped to the contact email field should havemapped_object = 'lead'
andmapped_field = 'email'
. The one that was mapped to the company field under the contact opt group should havemapped_object = 'lead'
andmapped_field = 'company'
. The one that was mapped to the primary company city field should havemapped_object = 'company'
andmapped_field = 'companycity'
. The form field that was not mapped at all should have null values there.When you map one field then it should be removed from mapping of other fields. Example: Map contact email field to a form field. Create another field. The contact email field is not in the mapping list.
Test submissions of different field types.
Test conditional fields
Test progressive profiling (behaviours)
List deprecations along with the new alternative:
form_fields.lead_field
column is deprecated. Usemapped_object
andmapped_field
instead.Mautic\FormBundle\Entity\Field::getLeadField()
andsetLeadField()
. Use getters and setters onmappedObject
andmappedField
properties instead.Mautic\FormBundle\Event\Service\FieldValueTransformer::isIsTransformed()
is deprecated as not used.